package org.ccay.manage.log.service;

import java.util.List;
import java.util.Map;

import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import org.ccay.core.exception.ApplicationException;
import org.ccay.log.LoggerInfoVO;


/**
 * 动态调整日志级别服务
 * @author chaowangbang
 *
 */
@Path("/logLevel")
@Produces("application/json")
public interface ILogLevelService {
	/** 
	 * 查询WebTrace总体信息
	 * @return
	 */
	@GET
	@Path("summary")
	Map<String,String> findWebTraceInfo();
	
	/**
	 * 日志级别列表
	 * @return
	 */
	@GET
	@Path("list")
	List<LoggerInfoVO> findAllLoggers();
	
	/**
	 * 查询单个Logger
	 * @return
	 */
	@GET
	@Path("single/{loggerName}")
	LoggerInfoVO findLogger(@PathParam("") LoggerInfoVO logger);
	
	/**
	 * 修改集群日志级别
	 * @param logger
	 * @throws ApplicationException
	 */
	@PUT
	@Path("single")
	void updateClusterLogLevel(LoggerInfoVO logger) throws ApplicationException;
	
	/**
	 * 修改当前服务器日志级别
	 * @param logger
	 * @throws ApplicationException
	 */
	@GET
	@Path("single/{loggerName}/{level}/{time}/{traceUserAccount}")
	void switchLogLevel(@PathParam("") LoggerInfoVO logger)throws ApplicationException;
}
